import {createApp} from 'vue'
import App from './App.vue'
import router from '@/router/index'
import {createPinia} from 'pinia'
import piniaPlugin from 'pinia-plugin-persistedstate'
import axios from '@/router/axios.js'

// Element Plus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css' // 引入样式
import locale from 'element-plus/es/locale/lang/zh-cn'
// 创建应用实例
const app = createApp(App)

// 使用插件
app.use(router)
app.use(ElementPlus, {locale})
// 创建 Pinia 状态管理并启用持久化插件
const pinia = createPinia()
pinia.use(piniaPlugin);
// 配置全局属性和插件
app.config.globalProperties.$http = axios
app.use(pinia)
// 挂载应用
app.mount('#app')
